import java.util.Scanner;

public class Test2 {
    //方法的重载!!!!!!
    public static int add(int a,int b){
        return a+b;
    }

    public static double add(double a,double b){
        return a+b;
    }

    public static int add(int a,int b,int c){
        return a+b+c;
    }

    public static double add(int a,double b,int c){
        return a+b+c;
    }

    public static double add(int a,int b,double c){
        return a+b+c;
    }

    public static void main1(String[] args) {

    }

    //递归！！！！！！
    public static int fac(int n){
        if(n==1){
            return 1;
        }
        int tmp = n*fac(n-1);
        return tmp;
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = fac(n);
        System.out.println(ret);
    }

    public static void print(int n){
        if(n<10){
            System.out.println(n);
        }else{
            print(n/10);
            System.out.println(n%10);
        }
    }
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        print(n);
    }

    public static int sum(int n){
        if(n==1){
            return 1;
        }else{
            int tmp = n+sum(n-1);
            return tmp;
        }
    }

    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = sum(n);
        System.out.println(ret);
    }

    public static int sumEvery(int n){
        if(n<10){
            return n;
        }
        int tmp = n%10 + sumEvery(n/10);
        return tmp;
    }


    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = sumEvery(n);
        System.out.println(ret);
    }

    public static int fib(int n){
        if(n==1||n==2){
            return 1;
        }
        int tmp = fib(n-1)+fib(n-2);
        return tmp;
    }


    public static int fib2(int n){
        if(n==1||n==2){
            return 1;
        }
        if(n<=0){
            return -1;
        }
        int f1 = 1;
        int f2 = 1;
        int f3 = -1;
        for (int i = 3; i <= n; i++) {
            f3 = f1+f2;
            f1 = f2;
            f2 = f3;
        }
        return f3;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = fib2(n);
        System.out.println(ret);
    }
}
